// header files
#include <windows.h>
#include <windowsx.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <dinput.h>
#include <atlbase.h>
#include <stdlib.h>
#include "gamewindow.h"
#include "object.h"
#include "inputdata.h"
#include "model.h"

// libraries
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")
#pragma comment (lib, "dinput8.lib")
#pragma comment (lib, "dxguid.lib")

// prototypes for...
// WinMain.cpp
LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
void DisplayWindow(GAMEWINDOW* gw, HINSTANCE hInstance, int nCmdShow);
bool HandleMessages();
// Loop.cpp
void MainLoop();
// Direct3D.cpp
void InitDirect3D(GAMEWINDOW* gw);
void CloseDirect3D();
void StartRender();
void EndRender();
void LoadModel(MODEL* Model, LPCTSTR File);
void SetCamera();
void AdjustCamera(float x, float y, float z);
void DrawModel(MODEL* Model, float x, float y, float z);
// DirectInput.cpp
void InitDirectInput(HINSTANCE hInstance, GAMEWINDOW* gw);
void GetKeys(BYTE* KeyState);
void GetMouse(DIMOUSESTATE* MouseState);
void CloseDirectInput(void);
// Render.cpp
void Render(OBJECT go[]);
void LoadGraphics();
// Logic.cpp
void Logic(OBJECT go[], INPUTDATA* InputData);
void InitGame(OBJECT go[]);
void NewBlock(OBJECT go[]);
void NewBrick(OBJECT* block, int blocktype);
void MoveBlock(OBJECT go[], int direction);
void RotateBlock(OBJECT go[]);
void DropBlock(OBJECT go[]);
void DeleteFullLayers(OBJECT go[]);
void DeleteLayer(OBJECT go[], int row);
// Input.cpp
void Input(INPUTDATA* InputData);